package com.aat.dxfy.json;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;

public class Test {

	public static void main(String[] args) {
		App app1=new App();
		App app2=new App();
		App app3=new App();
		
		app1.setAppName("CoreService");
		app2.setAppName("大唐传奇");
		app3.setAppName("冰心一片");
		
		app1.setAccesskey("f35t345t56yt3");
		app2.setAccesskey("w45t3456yh56y");
		app3.setAccesskey("we5ty4rtg54f4");
		
		app1.setSecret("8u74w5gt43e5ge6g");
		app2.setSecret("4564w5gt43e5ge6g");
		app3.setSecret("3r53w5gt43e5ge6g");
		
		List<App> allowedAccessApps=new ArrayList<>();
		allowedAccessApps.add(app2);
		allowedAccessApps.add(app3);
		
		
		app1.setAllowedAccessApps(allowedAccessApps);
		
		
		System.out.println(JSON.toJSONString(app1));
		
	}

}

class App {
	private String appName;
	private String accesskey;
	private String secret;
	private List<App> allowedAccessApps;

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getAccesskey() {
		return accesskey;
	}

	public void setAccesskey(String accesskey) {
		this.accesskey = accesskey;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public List<App> getAllowedAccessApps() {
		return allowedAccessApps;
	}

	public void setAllowedAccessApps(List<App> allowedAccessApps) {
		this.allowedAccessApps = allowedAccessApps;
	}

}
